﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Pahan.McuFusion.Common;
using Pahan.McuFusion.UI.Interfaces.NewWorkspaceWizardPages;

namespace Pahan.McuFusion.UI.Views.NewWorkspaceWizardPages
{
    public partial class SummaryPage : UserControl, ISummaryPage
    {
        public SummaryPage()
        {
            InitializeComponent();
        }

        #region Implementation of IWizardPage

        /// <summary>
        /// Gets the title of the page.
        /// </summary>
        public string Title
        {
            get
            {
                return "Summary";
            }
        }

        #endregion

        #region Implementation of ISummaryPage

        /// <summary>
        /// Gets or sets the selected programmer.
        /// </summary>
        public ProgrammerInfo Programmer
        {
            get
            {
                return programmer;
            }
            set
            {
                programmer = value;
                lbProgrammer.Text = value.Name;
            }
        }

        /// <summary>
        /// Gets or sets the selected MCU.
        /// </summary>
        public DeviceInfo Microcontroller
        {
            get
            {
                return mcu;
            }
            set
            {
                mcu = value;
                lbDevice.Text = String.Format("{0} {1}", value.Vendor, value.Model);
            }
        }

        /// <summary>
        /// Gets or sets the selected adapter.
        /// </summary>
        public HardwareAdapterInfo HardwareAdapter
        {
            get
            {
                return hardwareAdapter;
            }
            set
            {
                hardwareAdapter = value;
                lbHardwareAdapter.Text = value.Name;
            }
        }

        /// <summary>
        /// Gets or sets the selected interface.
        /// </summary>
        public HardwareInterfaceInfo HardwareInterface
        {
            get
            {
                return hardwareInterface;
            }
            set
            {
                hardwareInterface = value;
                lbHardwareInterface.Text = value.Name;
            }
        }

        #endregion

        #region Private Members

        private ProgrammerInfo programmer;
        
        private DeviceInfo mcu;
        
        private HardwareAdapterInfo hardwareAdapter;
        
        private HardwareInterfaceInfo hardwareInterface;

        #endregion
    }
}
